
/*

___________________________________________________________________________
Selection analysis includes the following items

_________
Main text

Figure 1: Share of new entrepreneurs by individual and parental income
	
Figure 2: Share of new incorporated entrepreneurs by individual and parental income and by parental entrepreneurship

Figure 3: Initial equity of new incorporated businesses by individual and parental income and by parental entrepreneurship

_________
Appendix

Table A2: Probability of starting an incorporated business: Comparing the relative importance of various predictors using dominance analysis

Figure A2: Share of new entrepreneurs by age

Figure A3: Share of new entrepreneurs by education

Figure A4: Share of highly-educated individuals by individual income

Figure A6: Share of new incorporated entrepreneurs by parental income using different income concepts

Figure A7: Share of new entrepreneurs by parental income: New firms vs. existing firms

*/









/*
________________________________________________________________________________
Main text
*/

/*
________________________________________________________________________________
Figure 1: Share of new entrepreneurs by individual and parental income
*/

use "$output\03_selection\fig1", clear

/*
Share of entrepreneurs by t-1 rank
*/

twoway scatter ie_own_shr rank, mc(maroon) msymbol(sh) graphr(c(white)) scheme(s2mono) ytitle("Share of entrepreneurs (%)", size(medium)) title("", size(medium) color(black) nobox) xtitle("Individual income rank at {it:t-1}", size(medium)) xtitle(, color(black)) legend(pos(10) ring(0) cols(1) rowg(0.5) region(style(none))) name(own, replace)

addplot own: scatter uie_own_shr rank, mc(navy) msymbol(dh) legend(order(1 "Incorporated entrepreneurs" 2 "Unincorporated entrepreneurs") region(style(none)) cols(1)) ysc(range(0 5.8)) ylabel(0(1)5, angle(0))

/*
Share of entrepreneurs by parental rank
*/

twoway scatter ie_prnt_shr rank, mc(maroon) msymbol(sh) graphr(c(white)) scheme(s2mono) ytitle("Share of entrepreneurs (%)", size(medium)) title("", size(medium) color(black) nobox) xtitle("Parental income rank", size(medium)) xtitle(, color(black)) legend(pos(10) ring(0) cols(1) rowg(0.5) region(style(none))) name(prnt, replace)

addplot prnt: scatter uie_prnt_shr rank, mc(navy) msymbol(dh) legend(order(1 "Incorporated entrepreneurs" 2 "Unincorporated entrepreneurs") region(style(none)) cols(1)) ysc(range(0 5.8)) ylabel(0(1)5, angle(0))

/*
Combine the two
*/

gr combine own prnt, graphr(c(white)) col(1) ysize(7) name(fig1, replace)
gr drop own prnt
graph export "$figs\fig1.eps", as(eps) preview(off) replace

/*
________________________________________________________________________________
Figure 2: Share of new incorporated entrepreneurs by individual and parental income and by parental entrepreneurship
*/

use "$output\03_selection\fig2", clear

/*
Share of IE by t-1 rank
*/

twoway scatter ie_own_peyes_shr rank, mc(maroon) msymbol(s) graphr(c(white)) scheme(s2mono) ytitle("Share of entrepreneurs (%)", size(medium)) title("", size(medium) color(black) nobox) xtitle("Individual income rank at {it:t-1}", size(medium)) xtitle(, color(black)) legend(pos(10) ring(0) cols(1) rowg(0.5) region(style(none))) name(own, replace)

addplot own: scatter ie_own_peno_shr rank, mc(maroon) msymbol(sh) legend(order(1 "Incorporated entrepreneurs, parent entrepreneur: yes" 2 "Incorporated entrepreneurs, parent entrepreneur: no") region(style(none)) cols(1)) ysc(range(0 5.8)) ylabel(0(1)5, angle(0))

/*
Share of IE by parental rank
*/

twoway scatter ie_prnt_peyes_shr rank, mc(maroon) msymbol(s) graphr(c(white)) scheme(s2mono) ytitle("Share of entrepreneurs (%)", size(medium)) title("", size(medium) color(black) nobox) xtitle("Parental income rank", size(medium)) xtitle(, color(black)) legend(pos(10) ring(0) cols(1) rowg(0.5) region(style(none))) name(prnt, replace)

addplot prnt: scatter ie_prnt_peno_shr rank, mc(maroon) msymbol(sh) legend(order(1 "Incorporated entrepreneurs, parent entrepreneur: yes" 2 "Incorporated entrepreneurs, parent entrepreneur: no") region(style(none)) cols(1)) ysc(range(0 5.8)) ylabel(0(1)5, angle(0))

/*
Combine the two
*/

gr combine own prnt, graphr(c(white)) col(1) ysize(7) name(fig2, replace)
gr drop own prnt
graph export "$figs\fig2.eps", as(eps) preview(off) replace

/*
________________________________________________________________________________
Figure 3: Initial equity of new incorporated businesses by individual and parental income and by parental entrepreneurship
*/

use "$output\03_selection\fig3", clear
gen decile_l = decile-0.05
gen decile_r = decile+0.05

/*
Initial equity by t-1 rank
*/

twoway scatter own_peyes decile_l, mc(maroon) msymbol(s) || rcap own_peyes_95lo own_peyes_95up decile_l, col(maroon) || , graphr(c(white)) scheme(s2mono) ytitle("Log initial equity", size(medium)) title("{it:Initial equity by individual rank}", size(medium) color(black) nobox) xtitle("Individual income decile rank at {it:t-1}", size(medium)) xtitle(, color(black)) legend(pos(10) ring(0) cols(1) rowg(0.5) region(style(none))) name(own, replace)

addplot own: scatter own_peno decile_r, mc(maroon) msymbol(sh) || rcap own_peno_95lo own_peno_95up decile_r, col(maroon) || , legend(order(1 "Parent entrepreneur: yes" 3 "Parent entrepreneur: no") region(style(none)) cols(1)) xsc(range(1 10)) xlabel(1(1)10) ysc(range(8.1 8.6)) ylabel(8.1(0.1)8.6, angle(0))

/*
Initial equity by parental rank
*/

twoway scatter prnt_peyes decile_l, mc(maroon) msymbol(s) || rcap prnt_peyes_95lo prnt_peyes_95up decile_l, col(maroon) || , graphr(c(white)) scheme(s2mono) ytitle("Log initial equity", size(medium)) title("{it:Initial equity by parental rank}", size(medium) color(black) nobox) xtitle("Parental income decile rank", size(medium)) xtitle(, color(black)) legend(pos(10) ring(0) cols(1) rowg(0.5) region(style(none))) name(prnt, replace)

addplot prnt: scatter prnt_peno decile_r, mc(maroon) msymbol(sh) || rcap prnt_peno_95lo prnt_peno_95up decile_r, col(maroon) || , legend(order(1 "Parent entrepreneur: yes" 3 "Parent entrepreneur: no") region(style(none)) cols(1)) xsc(range(1 10)) xlabel(1(1)10) ysc(range(8.1 8.6)) ylabel(8.1(0.1)8.6, angle(0))

/*
Combine the two
*/

gr combine own prnt, graphr(c(white)) col(1) ysize(7) name(fig3, replace)
gr drop own prnt
graph export "$figs\fig3.eps", as(eps) preview(off) replace









/*
________________________________________________________________________________
Appendix
*/

/*
________________________________________________________________________________
Table A2: Probability of starting an incorporated business: Comparing the relative importance of various predictors using dominance analysis
*/

* Copied from a .dta file, see '04_tabs'

/*
________________________________________________________________________________
Figure A2: Share of new entrepreneurs by age
*/

use "$output\03_selection\figA2", clear

twoway scatter ie_age_shr age, mc(maroon) msymbol(sh) graphr(c(white)) scheme(s2mono) ytitle("Share of entrepreneurs (%)", size(medium)) title("", size(medium) color(black) nobox) /*yline(2.7, lc(gs12) lp(solid))*/ xtitle("Age at {it:t-1}", size(medium)) xtitle(, color(black)) legend(ring(0) bplace(swest)) name(figA2, replace)

addplot figA2: scatter uie_age_shr age, mc(navy) msymbol(dh) xsc(range(24 56)) xlabel(25(5)55) ysc(range(0 6)) ylabel(0(1)6, angle(0)) legend(order(1 "Incorporated entrepreneurs" 2 "Unincorporated entrepreneurs") region(style(none)) cols(1))

graph export "$figs\figA2.eps", as(eps) preview(off) replace

/*
________________________________________________________________________________
Figure A3: Share of new entrepreneurs by education
*/

use "$output\03_selection\figA3_top", clear

label define ututku_aste_lbl 3 "Secondary" 4 "Secondary+" 5 "Bachelor-" 6 "Bachelor" 7 "Master" 8 "Doctor" 9 "Unknown"
label values ututku_aste ututku_aste_lbl

foreach var of varlist ie_edul_shr uie_edul_shr we_edul_shr {
	replace `var' = `var' * 100
}

twoway scatter ie_edul_shr ututku_aste, mc(maroon) msymbol(sh) graphr(c(white)) scheme(s2mono) ytitle("Share (%)", size(medium)) title("{it:Education level at t-1}", size(medium) color(black) nobox) xtitle("", size(medium)) xtitle(, color(black)) ysize(3) legend(ring(0) rowg(0.2) bplace(north)) name(levels, replace)
addplot levels: scatter uie_edul_shr ututku_aste, mc(navy) msymbol(dh)
addplot levels: scatter we_edul_shr ututku_aste, mc(gs6) msymbol(Oh) xlabel(3(1)9, valuelabel angle(45)) ysc(range(0 60)) ylabel(0(20)60, angle(0)) legend(order(1 "Incorporated entrepreneurs" 2 "Unincorporated entrepreneurs" 3 "Wage earners") region(style(none)) cols(1))

use "$output\03_selection\figA3_bottom", clear

replace ututku_ala=11 if ututku_ala==99
label define ututku_ala_lbl 0 "General" 1 "Educ." 2 "Hum. & arts" 3 "Social" 4 "Bus. & law" 5 "Natural" 6 "ICT" 7 "Tech." 8 "Agr. & for." 9 "Health" 10 "Service" 11 "Unknown"
label values ututku_ala ututku_ala_lbl

foreach var of varlist ie_eduf_shr uie_eduf_shr we_eduf_shr {
	replace `var' = `var' * 100
}

twoway scatter ie_eduf_shr ututku_ala, mc(maroon) msymbol(sh) graphr(c(white)) scheme(s2mono) ytitle("Share (%)", size(medium)) title("{it:Education field at t-1}", size(medium) color(black) nobox) xtitle("", size(medium)) xtitle(, color(black)) ysize(3) name(fields, replace)
addplot fields: scatter uie_eduf_shr ututku_ala, mc(navy) msymbol(dh)
addplot fields: scatter we_eduf_shr ututku_ala, mc(gs6) msymbol(Oh) xlabel(0(1)11, valuelabel angle(45)) ysc(range(0 0.3)) ylabel(0(10)30, angle(0)) legend(off)

gr combine levels fields, col(1) scheme(s2mono) title("", size(medium)) ysize(6) graphr(c(white)) name(figA3, replace)
gr drop levels fields
graph export "$figs\figA3.eps", as(eps) preview(off) replace

/*
________________________________________________________________________________
Figure A4: Share of highly-educated individuals by individual income
*/

use "$output\03_selection\figA4", clear

gen rank_uie=rank-0.2
gen rank_we=rank+0.2

twoway scatter uie_he_shr rank_uie, mc(navy*.4) msymbol(d) || scatter we_he_shr rank_we, mc(gs6*.4) msymbol(o) || scatter ie_he_shr rank, mc(maroon*.4) msymbol(s) || , graphr(c(white)) scheme(s2mono) ytitle("Share with at least a bachelor's degree (%)", size(medsmall)) title("", size(medium) color(black) nobox) xtitle("Individual income rank at {it:t-1}", size(medsmall)) xtitle(, color(black)) legend(order(3 "Incorporated entrepreneurs" 1 "Unincorporated entrepreneurs" 2 "Wage earners") cols(1) rowg(0.5) ring(0) pos(11) region(style(none))) ylabel(0(10)60, angle(0)) name(figA4, replace)

graph export "$figs\figA4.eps", as(eps) preview(off) replace

/*
________________________________________________________________________________
Figure A6: Share of new incorporated entrepreneurs by parental income using different income concepts
*/

use "$output\03_selection\figA6", clear

twoway scatter ie_prnt_mi_shr rank, mc(maroon) msymbol(sh) graphr(c(white)) scheme(s2mono) ytitle("Share of entrepreneurs (%)", size(medium)) title("", size(medium) color(black) nobox) xtitle("Parental income rank", size(medium)) xtitle(, color(black)) legend(pos(2) ring(0) cols(1) rowg(0.5)) name(figA6, replace)

addplot figA6: scatter ie_prnt_di_shr rank, mc(maroon) msymbol(d)

replace ie_prnt_ci_shr=. if _n==1
addplot figA6: scatter ie_prnt_ci_shr rank, mc(maroon) msymbol(o) legend(order(1 "Market income (baseline)" 2 "Disposable income" 3 "Capital income") region(style(none)) cols(1)) ylabel(0(1)3, angle(0))

graph export "$figs\figA6.eps", as(eps) preview(off) replace

/*
________________________________________________________________________________
Figure A7: Share of new entrepreneurs by parental income: New firms vs. existing firms
*/

use "$output\03_selection\figA7", clear

* All IE 2014
twoway scatter ie14_shr rank, mc(maroon*.4) msymbol(d) graphr(c(white)) scheme(s2mono) ytitle("Share of entrepreneurs (%)", size(medium)) title("Incorporated entrepreneurs", size(medium) color(black) nobox) xtitle("Parental income rank", size(medium)) xtitle(, color(black)) legend(pos(12) ring(0) cols(1) rowg(0.5) region(style(none))) name(ie, replace)

* All IE 2006
addplot ie: scatter ie06_shr rank, mc(maroon*.7) msymbol(o) 

* Joiners: IE
addplot ie: scatter newie_oldfirm_shr rank, mc(maroon) msymbol(s)

* Founders: IE
addplot ie: scatter ie_prnt_shr rank, mc(maroon) msymbol(sh) legend(order(1 "All entrepreneurs & all firms, 2014" 2 "All entrepreneurs & all firms, 2006" 3 "New entrepreneurs & existing firms, 1998-2014" 4 "New entrepreneurs & new firms, 1998-2014")) ysc(range(0 3.5)) ylabel(0(1)3, angle(0))

* All UIE 2014
twoway scatter uie14_shr rank, mc(navy*.4) msymbol(d) graphr(c(white)) scheme(s2mono) ytitle("Share of entrepreneurs (%)", size(medium)) title("Unincorporated entrepreneurs", size(medium) color(black) nobox) xtitle("Parental income rank", size(medium)) xtitle(, color(black)) legend(pos(12) ring(0) cols(1) rowg(0.5) region(style(none))) name(uie, replace)

* All UIE 2006
addplot uie: scatter uie06_shr rank, mc(navy*.7) msymbol(o) 

* Founders: UIE
addplot uie: scatter uie_prnt_shr rank, mc(navy) msymbol(sh) legend(order(1 "All entrepreneurs & all firms, 2014" 2 "All entrepreneurs & all firms, 2006" 3 "New entrepreneurs & new firms, 1998-2014")) ysc(range(0 3.5)) ylabel(0(1)3, angle(0))

* combine IE & UIE

gr combine ie uie, graphr(c(white)) col(1) ysize(7) name(figA7, replace)
gr drop ie uie
graph export "$figs\figA7.eps", as(eps) preview(off) replace
